#include "rtmp_push.h"
#include <iostream>
using namespace std;

extern "C" 
{
#include "libavcodec/avcodec.h"	
#include "libavformat/avformat.h"	
#include "libavutil/avutil.h"
}
#pragma comment(lib,"avformat.lib")
#pragma comment(lib,"avutil.lib")

int xerror(int errorno)
{
	char errorbuf[1024] = { 0 };
	av_strerror(errorno, errorbuf, 1024);
	cout << errorbuf << endl;
	getchar();
	return -1;
}

int rtmp_main()
{
	av_register_all();
	avformat_network_init();

	AVFormatContext * ictx = NULL;
	char inUrl[] = "Z:\\video_simple\\Forrest_Gump_IMAX.mp4";
	int s32Ret = avformat_open_input(&ictx, inUrl, 0, 0);
	if (s32Ret < 0)
	{
		return xerror(s32Ret);
	}
}

rtmp_push::rtmp_push(QWidget *parent)
	: QMainWindow(parent)
{
	ui.setupUi(this);
	
	rtmp_main();
	 
}
